//
//  TSJournalTabBarController.m
//  chart
//
//  Created by xu on 15/9/12.
//  Copyright (c) 2015年 xu. All rights reserved.
//

#import "TSReceiveTabBarController.h"
#import "TSUserViewController.h"
#import "TSSectionListViewController.h"
#import "TSTaskSearchViewController.h"
#import "TSReceiveFinishController.h"
#import "TSReceiveCommitController.h"
@implementation TSReceiveTabBarController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    
    TSReceiveFinishController *finishCol = [[TSReceiveFinishController alloc] init];
    finishCol.isJournal = YES;
    TSBaseNavigationController *nav_vc_finish = [[TSBaseNavigationController alloc] initWithRootViewController:finishCol];
    
    TSReceiveCommitController *commit_vc = [[TSReceiveCommitController alloc] init];
    
    TSBaseNavigationController *nav_vc_commit = [[TSBaseNavigationController alloc] initWithRootViewController:commit_vc];
    
    
    self.viewControllers = @[nav_vc_finish, nav_vc_commit];
    
    NSArray *tabBarTitle = @[@"进行中", @"已提交"];
    for (NSUInteger i = 0; i < self.viewControllers.count; i++) {
        UIViewController *viewController = [self.viewControllers objectAtIndex:i];
        if ([viewController isMemberOfClass:[UINavigationController class]]) {
            viewController = [[(UINavigationController *)viewController viewControllers] firstObject];
        }
        
        if (i == 0) {
            viewController.tabBarItem = [self tabBarItemWithImage:[NSString stringWithFormat:@"nav_nor_%zd", 3] SelectedImgName:[NSString stringWithFormat:@"nav_hlr_%zd", 3]];
        }
        else{
            viewController.tabBarItem = [self tabBarItemWithImage:[NSString stringWithFormat:@"nav_nor_%zd", i] SelectedImgName:[NSString stringWithFormat:@"nav_hlr_%zd", i]];
        }
        
        viewController.tabBarItem.tag = i;
        viewController.tabBarItem.title = tabBarTitle[i];
    }
}


@end
